<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    <script>
    //模板字符串插值
     let age=10;
     let str=`张三今年${age}岁了`;
     console.log(str)
    let money=10000;
    let str1=`张三要${money>=10000? "迎娶白富美":"想屁吃"}`;
    console.log(str1)
    


   //startsWith和eddWith
   let a="我是要成为海贼王的男人";
   let b=a.startsWith("我是");
   let c=a.endsWith("男人");
   console.log(b);
   console.log(c);
   


   //repeat(重复的遍数)
   let d=a.repeat(6);
   console.log(d);
   


   let mke=a.padStart(14,"路飞：");
   console.log(mke)
   let kaiduo=mke.padEnd(19,"凯多：找死");
   console.log(kaiduo);




   let id="111111111111111111";
   function fun(idNum){
    let last=idNum.slice(-6);
   let add=last.padStart(18,"*");
    return add;
   }
   console.log(fun(id));
   setInterval(function(){
        let data=new Date();
        let s=data.getSeconds()+"";
        console.log(s.padStart(2,"0"));
   },1000);
</script>
</body>
</html>